﻿namespace SourceCodeRepository.Tests.Common.StubedRepositories
{
    using System.Collections.Generic;
    using System.Linq;
    using Model;
    using Persistence.Repositories.Interfaces;

    public class LanguageRepositoryStub : ILanguageRepository
    {
        private IList<Language> internalList = new List<Language>();
        
        public void Save(Language item)
        {
            internalList.Add(item);
        }

        public void Update(Language item)
        {
            throw new System.NotImplementedException();
        }

        public IList<Language> GetAll(int? pageNumber)
        {
            throw new System.NotImplementedException();
        }

        public IList<Language> GetAllEntities()
        {
            return internalList;
        }

        public Language GetById(int id)
        {
            return internalList.Where(o => o.Id == id).FirstOrDefault();
        }

        public IList<Language> GetAllLanguages()
        {
            return internalList;
        }
    }
}